<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/pages/home.xhtml">
	<ui:define name="conteudo">
		<p:tabMenu activeIndex="0">
			<p:menuitem value="Empréstimo" url="emprestimo.jsf" />
			<p:menuitem value="Leitor" url="leitor.jsf" />
			<p:menuitem value="Livro" url="livro.jsf" />
			<p:menuitem value="Autor" url="autor.jsf" />
			<p:menuitem value="Editora" url="editora.jsf" />
			<p:menuitem value="Classificação" url="classificacao.jsf" />
		</p:tabMenu>
		<h:form>
			<h:panelGrid id="painel" columns="3" cellpadding="4">
				<h:outputLabel value="Leitor" />
				<p:selectOneMenu id="leitor" value="#" panelStyle="width:250px"
					effect="drop" style="width:160px" filter="true"
					filterMatchMode="startsWith">
					<f:selectItem itemLabel="---" itemValue="" />
					<f:selectItems value="#{MBLeitor.listarA}" var="leitor"
						itemLabel="#{leitor.leiNome}" itemValue="#{leitor.leiId}" />
				</p:selectOneMenu>
				<br />
				<h:outputLabel value="Livro" />
				<p:selectOneMenu id="livro" value="#" panelStyle="width:250px"
					effect="drop" style="width:160px" filter="true"
					filterMatchMode="startsWith">
					<f:selectItem itemLabel="---" itemValue="" />
					<f:selectItems value="#{MBLivro.listarA}" var="livro"
						itemLabel="#{livro.livTitulo}" itemValue="#{livro.livId}" />
				</p:selectOneMenu>
				<br />
				<h:outputLabel value="Data de Previsão" />
				<p:inputText
					value="#{MBEmprestimo.beanEmprestimo.empPrevisaoDevolucao}"
					id="previsao" required="true" requiredMessage="Campo obrigatório." />
				<p:message for="previsao" />
				<h:outputLabel value="Data de Devolução" />
				<p:inputText value="#{MBEmprestimo.beanEmprestimo.empDataDevolucao}"
					id="devolucao" required="true" requiredMessage="Campo obrigatório." />
				<p:message for="devolucao" />
				<p:commandButton value="Salvar" action="#{MBEmprestimo.salvar()}"
					update="painel" />
				<p:commandButton value="Cancelar" action="emprestimo"
					immediate="true" />
			</h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>
</html>